package com.shuogesha.platform.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.shuogesha.common.util.JsonResult;
import com.shuogesha.platform.entity.UnifiedUser;

@FeignClient(value = "cloudFast-platform-unifiedUser")
public interface UnifiedUserFeignClient {
	//管理端
	@RequestMapping(value = "/unifiedUser/list")
	public Object list(@RequestParam("name") String name, @RequestParam("pageNo") Integer pageNo,
			@RequestParam("pageSize") Integer pageSize);

	@RequestMapping(value = "/unifiedUser/get")
	public Object get(@RequestParam("id") Long id);

	@RequestMapping(value = "/unifiedUser/save", method = RequestMethod.POST)
	public Object save(@RequestBody UnifiedUser bean);

	@RequestMapping(value = "/unifiedUser/update", method = RequestMethod.POST)
	public Object update(@RequestBody UnifiedUser bean);

	@RequestMapping(value = "/unifiedUser/delete")
	public Object delete(Long[] ids);
	
	//服务端
	@RequestMapping(value = "/unifiedUser/updateLoginInfo", method = RequestMethod.POST)
	public JsonResult<UnifiedUser> updateLoginInfo(@RequestBody UnifiedUser bean);
	
	@RequestMapping(value = "/unifiedUser/login")
	public JsonResult<UnifiedUser> login(@RequestParam("username") String username,@RequestParam("password") String password,@RequestParam("ip") String ip);
	
	@RequestMapping(value = "/unifiedUser/findById")
	public UnifiedUser findById(@RequestParam("id") Long id);
	
	@RequestMapping(value = "/unifiedUser/reg")
	public JsonResult<UnifiedUser> reg(@RequestParam("realname") String realname,@RequestParam("username") String username, @RequestParam("password") String password,
			@RequestParam("email") String email,@RequestParam("phone") String phone,@RequestParam("sex") String sex,@RequestParam("ip") String ip,@RequestParam("type") String type,@RequestParam("avatar") String avatar);
	
	@RequestMapping(value = "/unifiedUser/updatePassword")
	public JsonResult<UnifiedUser> updatePassword(@RequestParam("password") String password,@RequestParam("id") Long id);
	
	@RequestMapping(value = "/unifiedUser/updateInfo")
	public JsonResult updateInfo(@RequestParam("id")Long id,@RequestParam("realname") String realname,@RequestParam("username") String username,@RequestParam("password") String password,
			@RequestParam("email") String email,@RequestParam("phone") String phone,@RequestParam("sex") String sex,@RequestParam("avatar") String avatar);
	//其他
}
